package com.leadingsoft.pwxk.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseStatus;
import org.springframework.web.bind.annotation.RestController;

import com.leadingsoft.pwxk.converter.AuditWaterEmissionsConverter;
import com.leadingsoft.pwxk.dto.AuditWaterEmissionsDto;
import com.leadingsoft.pwxk.model.AuditWaterEmissions;
import com.leadingsoft.pwxk.service.AuditWaterEmissionsService;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;

@Api(description="水污染排放信息相关")
@RestController
@RequestMapping("api/auditWaterEmissions")
public class AuditWaterEmissionsController {

	@Autowired
	AuditWaterEmissionsService auditWaterEmissionsService;
	
	@Autowired
	AuditWaterEmissionsConverter auditWaterEmissionsConverter;
	
	
	@ApiOperation("水污染排放信息")
	@GetMapping(path = "{dataId}")
	@ResponseStatus(code = HttpStatus.OK)
	public AuditWaterEmissionsDto get(@PathVariable(value = "dataId") String dataId) {
		AuditWaterEmissions auditWaterEmissions = auditWaterEmissionsService.getByDataId(dataId);
		return auditWaterEmissionsConverter.toDto(auditWaterEmissions);
	}
}
